/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package umled.model;

import org.w3c.dom.*;
/**
 *
 * @author ANor
 */
public abstract class UMLComponent extends UMLElement {
    private UMLVisible visible;
    
    public UMLComponent(String name, UMLElement parent, int xPos, int yPos, int width, int height, UMLVisible v){
        super(name, parent, xPos, yPos, width, height);
        visible = v;
    }
    public UMLVisible getVisible(){
        return visible;
    }
    public void setVisible(UMLVisible v){
        visible = v;
    }
    /**
     * Returns XML-represention of current component
     * @param document to which this component will be appended
     * @return XML-represention of current component
     */
    @Override
    public Element getXML( Document document ){
        Element element = super.getXML( document );
        
        Element stateOfVisible  = document.createElement( "Visible" );
        stateOfVisible.appendChild( document.createTextNode( visible.toString2() ) );
        element.appendChild( stateOfVisible );
        
        return element;
    }
}
